import request from '../../utils/request'

export function getList() {
  return request.ajax({
      url: `/mall/address`,
      method: 'post'
  })
}
export function getOne(id) {
  return request.ajax({
      url: `/mall/address/getOne/${id}`,
      method: 'post'
  })
}
export function getDefault() {
  return request.ajax({
      url: `/mall/address/getDefault`,
      method: 'post'
  })
}

export function setDefault(id) {
  return request.ajax({
    url:`/mall/address/setDefault/${id}`,
    method:'post'
  })
}

export function resetDefault(id) {
  return request.ajax({
    url:`/mall/address/resetDefault/${id}`,
    method:'post'
  })
}
export function del(id) {
  return request.ajax({
    url:`/mall/address/del/${id}`,
    method:'post'
  })
}
export function getDetail(id) {
  return request.ajax({
    url:`/mall/address/getDetail/${id}`,
    method:'post'
  })
}
export function save(params) {
  return request.ajax({
    url:`/mall/address/save`,
    method:'post',
    loading:true,
    params
  })
}

export function edit(params) {
  return request.ajax({
    url:`/mall/address/edit`,
    method:'post',
    isJson:true,
    loading:true,
    params
  })
}